package com.example.dzchat;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        API.chat(this, "我肚子疼，请问我要吃点什么药呢？多久会有效果？", "", new Okhttp.Objectcallback() {
            @Override
            public void onsuccess(String st) throws Exception {
                Log.e("测试", "数据"+st);
                RE re = JSONUtils.parseJSON(st, RE.class);
                String response = re.getResponse();
                Log.e("ZZZ", "数据："+response);

            }

            @Override
            public void onFalia(int code, String errst) {
                Log.e("测试", "失败！" + errst.toString());
            }
        });
    }
}